<!-- 黑暗模式 -->
<template>
  <div>
    <el-switch v-model="model" active-value="light" inactive-value="dark" />
  </div>
</template>

<script setup>
import { useDark, useToggle } from "@vueuse/core";

import { ref, watch } from "vue";
import { useConfig } from "@/store/baseConfig";
const config = useConfig();

const model = ref("light");

const isDark = useDark();
const toggleDark = useToggle(isDark);

watch(model, (newValue, oldValue) => {
  toggleDark();
  console.log(isDark, "isDark");
});

const toggleHandler = () => {};
</script>
